package Text_67;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;
import java.util.Scanner;

public class Code {

	public static void main(String[] args) {
		 //随机点名，不重复，点完重新开始
        ArrayList<String> list = new ArrayList<>();
        ArrayList<String> newList = new ArrayList<>();
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入点名轮数：");
        int num = sc.nextInt();
        Collections.addAll(list,"郭靖","杨过","韦小宝","康熙","尔康","张三","李四");
        //外层表示循环的轮数
        for (int i = 0; i <num ; i++) {
            System.out.println("======第"+(i+1)+"轮======");
            Random r = new Random();
            int count = list.size();
            //内层表示循环抽取的过程
            for (int j= 0; j < count; j++) {
                int index = r.nextInt(list.size());
                String name = list.get(index);
                System.out.println(name);
                list.remove(name);
                newList.add(name);
            }
            //为下次点名做准备
            list.addAll(newList);
            newList.clear();

        }



	}

}
